<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@taglib uri="/WEB-INF/tld/importTag.tld" prefix="importTag"%>
<%@ taglib uri="http://www.yaodian100.com/jsp/yaodian100" prefix="yaodian100" %>
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@ taglib uri="/WEB-INF/tld/pageutil.tld" prefix="pu"%>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>
<c-rt:set var="frontContentPath" value='<%=ServerValue.getFrontContextPath()%>'/>
<c-rt:set var="frontContentHtmlPath" value='<%=ServerValue.getFrontContentHtmlPath()%>'/>
<c-rt:set var="hostName" value='<%=request.getServerName()%>'/>
<c-rt:set var="imgDomain"><%=ServerValue.getImgDomain()%></c-rt:set>
<s:url var="prodlink" value="/product/product.do"/>
${pu:reqSet('currentDate', pu:currentDate()) }
<style>
.filtertool .pferent-warp .pf-harea-f .checkbox{margin:5px 5px 0;*margin:5px 4px 0;cursor:pointer;float:left;}
.morepdinfo1{position:absolute; z-index:1000;top:5px;left:50px;width:310px;}
.morepdinfo1 .arrowarea{float:left;margin:5px 0px;overflow:hidden;}
.morepdinfo1 .arrowarea img{margin-top:140px;}
.morepdinfo1 .pdinfo{float:left;border:2px solid #d03070;padding:10px;background:#FFF;}
.morepdinfo1 .pdinfo img{padding:5px;border:#CCC 1px solid;}
.morepdinfo1 .pdinfo em a{display:block;width:21em;height:15px;overflow:hidden;font-size:12px;color:#d02b6d;}
.morepdinfo1 .pdinfo h2{display:block;width:17em;height:36px;*height:35px;overflow:hidden;font-size:15px;margin:5px 0;}
.morepdinfo1 .pdinfo .money-area{display:block;}
.morepdinfo1 .pdinfo .money-area s{text-decoration:none;display:inline-block; width:9em; float:left;padding-top:3px;}
.morepdinfo1 .pdinfo .money-area s span{background:url(/images/s_line.gif) repeat-x 0 0; color:#999;padding-top:.15em; background-position:0 .15em;}
.morepdinfo1 .pdinfo .money-area strong{display:inline-block;float:left;color:#d02b6d; font-weight:bold;display:block; text-align:right; width:11.5em; height:2em;overflow:hidden;}
.morepdinfo1 .pdinfo .money-area strong span{font-size:15px; display:inline-block;padding-top:1px;}
.morepdinfo1 .pdinfo .pferent-area{clear:both;line-height:20px;}
.morepdinfo1 .pdinfo .pferent-area p{width:250px;height:20px;overflow:hidden;color:#666;}
.morepdinfo1 .pdinfo .btn-area{margin:10px 45px 0px;float:none;width:160px;}
.morepdinfo1 .pdinfo .fielddot{background:url(/images/link_dote.gif) repeat-x 0 center;font-size:0px;width:250px;height:15px;}
</style>
<script src="/js/jquery.lazyload.yaodian100.js"></script>
<script language="javascript">

	$(function(){
		$('img').lazyload();
		$('img', $('.arrowarea')).each(function(){
			$(this).attr('src', $(this).attr('original'));
		});
		$('img', $('.sub-menu')).each(function(){
			$(this).attr('src', $(this).attr('original'));
		});
		$('#form_searchKeyword').keyup(function(){
			$('#keyword').attr('value', $('#form_searchKeyword').attr('value'));
			if($(this).attr('value')!=''){
				hadKeyin=true;
				$('#keyword').attr('class', 'search-page');
			}else{
				hadKeyin=false;
				$('#keyword').attr('class', 'search-dpage');
			}
		});
		$('#form_searchKeyword').change(function(){
			$('#keyword').attr('value', $('#form_searchKeyword').attr('value'));
			if($(this).attr('value')!=''){
				hadKeyin=true;
				$('#keyword').attr('class', 'search-page');
			}else{
				hadKeyin=false;
				$('#keyword').attr('class', 'search-dpage');
			}
		});
		$('#checkAllFlag').click(function(){
			if($('#checkboxImg').attr('src')=='/images/search/checkbox-on.gif'){
				document.formObj.flag2.checked=false;
				document.formObj.flag3.checked=false;
				document.formObj.flag4.checked=false;
				document.formObj.flag5.checked=false;
				document.formObj.flag6.checked=false;
				document.formObj.flag7.checked=false;
				$('#checkboxImg').attr('src', '/images/search/checkbox-null.gif');
				totalCheck=0;
			}else{
			document.formObj.flag2.checked=true;
			document.formObj.flag3.checked=true;
			document.formObj.flag4.checked=true;
			document.formObj.flag5.checked=true;
			document.formObj.flag6.checked=true;
			document.formObj.flag7.checked=true;
			$('#checkboxImg').attr('src', '/images/search/checkbox-on.gif');
			totalCheck=6;
			}
		});
		$(".clear-history").click(function(){
			$.post("/ecmall/product/jsonClearPV.do",{},clearPVCallback,"json");
		});
		$('#clearSearchFilterForm').click(function(){
			document.formObj.minPrice.value='';
			document.formObj.maxPrice.value='';
			document.formObj.partner.checked=false;
			document.formObj.flag1.checked=false;
			document.formObj.flag2.checked=false;
			document.formObj.flag3.checked=false;
			document.formObj.flag4.checked=false;
			document.formObj.flag5.checked=false;
			document.formObj.flag6.checked=false;
			document.formObj.flag7.checked=false;
			$('#checkboxImg').attr('src', '/images/search/checkbox-null.gif');
			totalCheck=0;
		});
		$('.pferent-warp').mouseover(function(){
			$('#promotionEventItem').show();
		});
		$('.pferent-warp').mouseout(function(){
			$('#promotionEventItem').hide();
		});
		$('.pferent-warp').mouseover(function(){
			$('.pferent-warp > a').attr('class', 'pf-harea-f');
		});
		$('.pferent-warp').mouseout(function(){
			$('.pferent-warp > a').attr('class', 'pf-harea');
		});
		$('.op-wrap').mouseover(function(){
			$('.filterdrop').show();
		});
		$('.op-wrap').mouseout(function(){
			$('.filterdrop').hide();
		});
		
			$('.arrowarea > img').css('margin-top', 0);

			$('.p_div').each(function(){
				var index=$(this).attr('id').replace('p_div_', '');
				$(this).mouseout(function(){
					focusItem='';
					
					setTimeout('hideItem('+index+')', 200);
					
				});
				
				//$('#p_div_'+index).mouseover(function(){
				//	buildPop(index);
				//	focusItem=index;
				//	setTimeout('checkItem('+index+')', 1500);
			  	//});

				
			});
			
		
		$('.camCheckbox').each(function(i){
			$(this).click(function(){
				if($(this).attr('checked')){
					totalCheck++;
					if(totalCheck==6){
						$('#checkboxImg').attr('src', '/images/search/checkbox-on.gif');
					}else if(totalCheck>0){
						$('#checkboxImg').attr('src', '/images/search/checkbox-gray.gif');
					}else{
						$('#checkboxImg').attr('src', '/images/search/checkbox-null.gif');
					}
				}else{
					totalCheck--;
					if(totalCheck>0){
						$('#checkboxImg').attr('src', '/images/search/checkbox-gray.gif');
					}else{
						$('#checkboxImg').attr('src', '/images/search/checkbox-null.gif');
					}
				}
			});
		});
		$('.filterdrop > li > a').each(function(){
			$(this).click(function(){
				$('.filterdrop > li > a').each(function(){
					$(this).removeClass('switchon');
				});
				$(this).addClass('switchon');
				$('.filterdrop').hide();
			});
		});
	});
	function checkItem(index){
		
		if(index==focusItem && focusItem!=''){
			
			showItem(index);
		}else{
			$('.morepdinfo1').each(function(){
				$(this).hide();
			});
			$('#moreInfoDiv').hide();
		}
	}
	function hideItem(index){
		
		if(index==focusItem && focusItem!=''){
			showItem(index);
		}else{
			$('.morepdinfo1').each(function(){
				$(this).hide();
			});
			$('#moreInfoDiv').hide();
		}
	}
	function showItem(index){
		var offset = $('#theId_'+index).offset();
		var infoLeft=offset.left+140;
		var showOnLeft=0;
		if(offset.left>(310) && getBrowserWidth()-offset.left<(310+160)){
			infoLeft=offset.left-(280);
			$('#morepdinfo1_'+index).css('left', infoLeft);
			//show on left
			$('#infoLeft_'+index).hide();
			$('#infoRight_'+index).show();
			showOnLeft=1;
		}else{
			//show on right
			showOnLeft=0;
			infoLeft=offset.left+120;
	  		$('#morepdinfo1_'+index).css('left', infoLeft);
	  		$('#infoLeft_'+index).show();
			$('#infoRight_'+index).hide();
			
		}
		var topShift=340;
		var infoTop=offset.top-topShift;
		$('.arrowarea').css('margin-top', 220);
		//BOTTOM POSITION

		var bottomPosition=getScrollTop()+getBrowserHeight();
		if(bottomPosition-offset.top<infoTop+$('#morepdinfo1_'+index).height()){
			infoTop=bottomPosition-$('#morepdinfo1_'+index).height();
			if(bottomPosition-(offset.top-90)<0){
				infoTop=offset.top-$('#morepdinfo1_'+index).height();
			}	
			if(bottomPosition-$('#morepdinfo1_'+index).height()>offset.top-140){
				infoTop=offset.top-200;
			}
		}
		if(offset.top-getScrollTop()-topShift<140){
			infoTop=getScrollTop();
			if(getScrollTop()>offset.top-140){
				infoTop=offset.top-140;
			}
			
			
		}
		$('.arrowarea').css('margin-top', offset.top-infoTop-140+20);

		var infoLeftShift=0;
		if(showOnLeft==0){
			infoLeftShift=15;
		}
	  $('#morepdinfo1_'+index).css('top', infoTop);
		$('#moreInfoDiv').css('top', infoTop);
		$('#moreInfoDiv').css('left', infoLeft+infoLeftShift);
		$('#moreInfoDiv').css('height', $('#morepdinfo1_'+index).height()-5);
		$('#moreInfoDiv').css('width', $('#morepdinfo1_'+index).width()-30);
		
		$('#moreInfoIframe').css('height', $('#morepdinfo1_'+index).height()-5);
		$('#moreInfoIframe').css('width', $('#morepdinfo1_'+index).width()-30);
		
		$('#moreInfoDiv').show();
	  
	  $('#morepdinfo1_'+index).show();

	}
	var focusItem;
	<c-rt:set var="flagCount" value="0" scope="request"/>
	<c-rt:if test="${param.flag2=='1'}">
	<c-rt:set var="flagCount" value="${flagCount+1}" scope="request"/>
	</c-rt:if>
	<c-rt:if test="${param.flag3=='1'}">
	<c-rt:set var="flagCount" value="${flagCount+1}" scope="request"/>
	</c-rt:if>
	<c-rt:if test="${param.flag4=='1'}">
	<c-rt:set var="flagCount" value="${flagCount+1}" scope="request"/>
	</c-rt:if>
	<c-rt:if test="${param.flag5=='1'}">
	<c-rt:set var="flagCount" value="${flagCount+1}" scope="request"/>
	</c-rt:if>
	<c-rt:if test="${param.flag6=='1'}">
	<c-rt:set var="flagCount" value="${flagCount+1}" scope="request"/>
	</c-rt:if>
	<c-rt:if test="${param.flag7=='1'}">
	<c-rt:set var="flagCount" value="${flagCount+1}" scope="request"/>
	</c-rt:if>
	var totalCheck=${flagCount};
	function getScrollTop(){
		if ($.browser.msie) {
			return document.compatMode == "CSS1Compat"?document.documentElement.scrollTop:document.body.scrollTop;
		}else{
			if(document.documentElement.scrollTop){
				return document.documentElement.scrollTop;
			}else{
				return document.body.scrollTop;
			}
		}
	}
	function getBrowserHeight() {
		if ($.browser.msie) {
		return document.compatMode == "CSS1Compat"?document.documentElement.clientHeight:document.body.clientHeight;
		} else {
		return self.innerHeight;
		}
		}
		//取得瀏覽器視窗寬度

		function getBrowserWidth() {
		if ($.browser.msie) {
		return document.compatMode == "CSS1Compat"?document.documentElement.clientWidth:document.body.clientWidth;
		} else {
		return self.innerWidth;
		}
		}
		function encodeKeyword2_(){
			if(document.formObj.searchKeyword.value==""){
				location.href="/ecmall/category/categoryAll.do?z="+document.formObj.z.value+"&sortOrderType="+document.formObj.sortOrderType.value+"&pageSize="+document.formObj.pageSize.value;
			}else{
				if(document.formObj.sortOrderType.value=='6'){
					document.formObj.sortOrderType.value='0';
				}
				encodeKeyword2();
			}
			
		}
		function encodeKeyword2_2_(){
			if(document.formObj.searchKeyword.value=="" && document.formObj.z.value==''){
				alertDialog('高级搜索','请输入<em>商品关键字</em>或商品类别！','','400','180');
			}else{
				if(document.formObj.searchKeyword.value==''){
					if(document.formObj.sortOrderType.value=='6'){
						document.formObj.sortOrderType.value='0';
					}
				}
				encodeKeyword2();
			}
			
		}
		var showIndex='';
		function buildPop(index){
			if(showIndex!=''){
				var indexs=showIndex.split(',');
				var hasIndexed=false;
				for(i=0;i<indexs.length;i++){
					if(indexs[i]==index){
						hasIndexed=true;
						break;
					}
				}
				if(!hasIndexed){
				showIndex+=','+index;
				}else{
					return;
				}
			}else{
				showIndex=index;
			}
			
			var productId=$('#productId'+index).attr('value');
			var ct=$('#ct'+index).attr('value');
			var productId_4=$('#productId_4'+index).attr('value');
			var promoteName=$('#promoteName'+index).attr('value');
			var escapePromoteName=$('#escapePromoteName'+index).attr('value');
			var escapeProductName=$('#escapeProductName'+index).attr('value');
			var listPrice=$('#listPrice'+index).attr('value');
			var shelfPrice=$('#shelfPrice'+index).attr('value');
			var campaignStr='';
			$('.campaigns'+index).each(function(){
				campaignStr+='<p><span class="type-4">优惠</span><span title="'+$(this).attr('value')+'">'+$(this).attr('value')+'</span></p> ';
			});
			var hasCoupon=$('#hasCoupon'+index).attr('value');
			var coupon=$('#coupon'+index).attr('value');
			var couponStr='';
			if(hasCoupon=='true'){
				
				couponStr='<p><span class="type-money">&nbsp;</span>买就<span class="txt-rd">送积分 '+coupon+'</span></p>';
			}
			var hasPresent=$('#hasPresent'+index).attr('value');
			var present=$('#present'+index).attr('value');
			var presentStr='';
			if(hasPresent=='true'){
				presentStr='<p><span class="type-2">赠品</span> <span title="'+present+'">'+present+'</span> </p>';
			}
			var productType=$('#productType'+index).attr('value');
			var hasAddon=$('#hasAddon'+index).attr('value');
			var addonStr='';
			if(productType!='6' && hasAddon=='true'){
				addonStr='<p><span class="type-3">加購</span>搭配加购享加值优惠</p> ';
			}
			var expectShipDate=$('#expectShipDate'+index).attr('value');
			var expectShipDateStr='';
			if(productType=='1'){
				expectShipDateStr='<p class="pre-txt"><span class="type-1">预购</span>预计<span class="txt-rd">'+expectShipDate+'</span>出货</p>';
			}
			var content=''+
				 

				 '<a href="/ecmall/product/product.do?productId='+productId+'&z='+ct+'"><img src="http://s.yaodian100.com/PImg/'+productId_4+'/'+productId+'/'+productId+'_m250.jpg" border="0"  onError="this.src=\'/PImg/blank_250.gif\'"></a>'+
				 '<em><a href="/ecmall/product/product.do?productId='+productId+'&z='+ct+'" title="'+promoteName+'">'+escapePromoteName+'</a></em>'+
				 '<h2><a href="/ecmall/product/product.do?productId='+productId+'&z='+ct+'">'+escapeProductName+'</a></h2>'+
				 '<div class="fielddot"> </div>'+
				 '<div class="money-area"><s><span>市场价:￥'+listPrice+'</span></s><strong>会员价:<span>￥'+shelfPrice+'</span></strong></div>'+
				         '<div class="pferent-area">'+
						 campaignStr+
				         couponStr+
				         presentStr+
				         addonStr+
				         expectShipDateStr+
				           '</div>'+
				           '<div class="fielddot"> </div>'+
				           '<div class="btn-area">'+
				           
				           '<a href="${prodlink}?productId='+productId+'&z='+ct+'" class="sbuy" target="_blank">购买</a>'+
				           '<a href="#" id="addWishList_'+productId+'_'+shelfPrice+'" class="icon-collection" onclick="addToWish(this)">加入收藏</a></div>'+
				         
					'';

			$('#morepdinfo1_'+index+' .pdinfo').html(content);
			
		}
		function clearPVCallback(clearPV){
			if ( clearPV == "true" ) $(".my-history > li").remove();
			$(".clear-history").hide();
			$(".my-history").append('<li class="no-recode">您没有任何记录</li>');
		}
		function addToWish(_this){
		    cpId = $(_this).attr('id').split('_')[1];
				cpPrice = $(_this).attr('id').split('_')[2];
				$.post("<%=ServerValue.getFrontContextPath()%>/checkLogin.do",{pathparam:'<%=ServerValue.getFrontHostname()%>'+window.location.pathname+"?<%=request.getQueryString()%>&cpId="+cpId+"&cpPrice="+cpPrice},callback,"json");
				function callback(result){
					if(result=='login'){
						$.post("/ecmall/nonMember/checkLogin.do",{},saveWishNonmemberCheckResultP,"json");
					}else{
						window.location.replace("<%=ServerValue.getFrontContextPath()%>/tologin.do?redirect_url="+result); 
					}
				}
		    }
</script>
<jsp:include page="/common/collection.jsp"/>
<div class="tocollect">
	<a href="#" id="addCategoriesList_${category.id}" class="icon-collection">收藏此分类</a>
</div>
<div class="sidebar">
	<!-- menu start -->
	<importTag:static path="${frontContentHtmlPath}${category.id}/SIDEBAR.html"/>
	<!-- 瀏覽記碌 -->
	 <div class="pd-sidebar">
      <ul class="my-history">
      	<c-rt:choose>
	      	<c-rt:when test="${empty mpvList}">
	      		<li class="no-recode">您没有任何记录</li>
	      	</c-rt:when>
	      	<c-rt:otherwise>
	      	<a href="###" class="clear-history">清除</a>
		        <c-rt:forEach items="${mpvList}" var="mpv" varStatus="index">
		        	<li class="${index.count eq fn:length(mpvList) ? 'lastone' :'' }">
		        		<a class="a-img" href="${frontendContextPath}/ecmall/product/product.do?productId=${mpv.productId}&hpp=history" target="_blank">
		        			<img width="50" height="50" alt="" src="${imgDomain}/PImg/${pu:substring(mpv.productId, 0,4) }/${mpv.productId }/${mpv.productId}_m50.jpg" onError="this.src='/PImg/blank_50.gif'">
		        		</a>
		        		<a class="pdname" href="${frontendContextPath}/ecmall/product/product.do?productId=${mpv.productId}&hpp=history" target="_blank">${mpv.productName}</a>
		        		<strong>￥ <fmt-rt:formatNumber value="${mpv.shelfPrice}"  pattern="####0.0"/></strong>
		        	</li>
		        </c-rt:forEach>
	      	</c-rt:otherwise>
      	</c-rt:choose>
     	</ul>
    </div>     
	<!-- menu end -->
	<c-rt:if test="${fn:endsWith(hostName, 'yaodian100.com')}">
		<div class="ad-sky">
			<script type="text/javascript">
				GA_googleFillSlot("yd100_${tempZId}_sidebar_right_image_01");
			</script>
		</div>
	  <div class="lt-bn-end">
	  	<script type="text/javascript">
				GA_googleFillSlot("yd100_${tempZId}_sidebar_right_image_02");
				GA_googleFillSlot("yd100_${tempZId}_sidebar_right_image_03");
			</script>
	  </div> 
  	</c-rt:if> 	
</div>
<!-- content start -->
<div class="content">	
	<!-- recommend start -->
	<importTag:static path="${frontContentHtmlPath}PRODUCTRC/${category.id}/RECOMMEND_V3.html"/>
	<!-- content end -->	
<form name="formObj" action="/ecmall/search/search.do" method="get" id="formObj" acceptcharset="UTF-8">
  <div class="filterbar">
  
	<input type="hidden" name="searchWithBrief" value="${!empty param.searchWithBrief?param.searchWithBrief:'1' }"/>
	<input type="hidden" name="searchWithDescription" value="${!empty param.searchWithDescription?param.searchWithDescription:'1' }"/>
	<input type="hidden" name="startDate" value="${param.startDate }"/>
	<input type="hidden" name="endDate" value="${param.endDate }"/>
	<input type="hidden" name="fuzzySearch" value="${param.fuzzySearch }"/>
	<input type="hidden" name="z" value="${param.z }"/>
  	<div class="filtertool">
		
          <div class="f-lt"><span>关键字：</span><input type="text" class="filter-kword" id="form_searchKeyword" name="searchKeyword" value="${param.searchKeyword }"></div> 
          <div class="f-lt"><span class="fprice-txt">价格区间：</span><input type="text" class="filter-price" name="minPrice" value="${param.minPrice }"></div> 
          <div class="f-lt"><span class="fprice-txt2">至</span><input type="text" class="filter-price" name="maxPrice" value="${param.maxPrice }"><span class="fprice-txt2">元</span></div> 
          <div class="f-lt"> 
          <div class="pferent-warp"> 
          <a href="javascript:void(0);" class="pf-harea" id="checkAllFlag">
          <c-rt:if test="${flagCount==0}">
          <img id="checkboxImg" src="/images/search/checkbox-null.gif" class="checkbox"/>
          </c-rt:if>
          <c-rt:if test="${flagCount>0 && flagCount<6}">
          <img id="checkboxImg" src="/images/search/checkbox-gray.gif" class="checkbox"/>
          </c-rt:if>
          <c-rt:if test="${flagCount==6}">
          <img id="checkboxImg" src="/images/search/checkbox-on.gif" class="checkbox"/>
          </c-rt:if>
          <span>限优惠活动</span></a> 
          <ul id="promotionEventItem" class="pfitem" style="display:none"> 
          <li><label><input type="checkbox" class="checkbox camCheckbox" value="1" name="flag2" <c-rt:if test="${param.flag2=='1' }">checked="checked"</c-rt:if>><span>立减优惠</span></label></li> 
          <li><label><input type="checkbox" class="checkbox camCheckbox" value="1" name="flag3" <c-rt:if test="${param.flag3=='1' }">checked="checked"</c-rt:if>><span>立折优惠</span></label></li> 
          <li><label><input type="checkbox" class="checkbox camCheckbox" value="1" name="flag4" <c-rt:if test="${param.flag4=='1' }">checked="checked"</c-rt:if>><span>送赠品</span></label></li> 
          <li><label><input type="checkbox" class="checkbox camCheckbox" value="1" name="flag6" <c-rt:if test="${param.flag6=='1' }">checked="checked"</c-rt:if>><span>任选商品</span></label></li> 
          <li><label><input type="checkbox" class="checkbox camCheckbox" value="1" name="flag7" <c-rt:if test="${param.flag7=='1' }">checked="checked"</c-rt:if>><span>加购商品</span></label></li> 
          <!--[if IE 6]><iframe class="selectbug" frameborder="0" scrolling="no" src="about:blank"></iframe><![endif]--> 
          </ul></div></div> 
          <div class="f-lt"><div class="daphne-wrap"><label><input type="checkbox" class="checkbox" id="DAPHNE" value="DAPHNE" name="partner" <c-rt:if test="${pu:contain(param.partner, 'DAPHNE') }">checked="checked"</c-rt:if>><span>门店取货</span></label></div></div>
          
          <div class="f-lt"><label><input type="checkbox" class="checkbox" id="flag01" value="1" name="flag1" <c-rt:if test="${param.flag1=='1' }">checked="checked"</c-rt:if>></input><span>不包含预购</span></label></div> 
          <div class="submit-wrap"><a id="submitSearchFilterForm" href="#" onclick="encodeKeyword2_2_();return false;" class="submit-btn"><span>确认</span></a><a id="clearSearchFilterForm" href="#" class="clear-btn2"><span>清除</span></a></div> 
        
        </div> 
        <div class="ordertool"> 
	<div class="f-lt"><span>排序：</span><div class="op-wrap"><a class="ca-orderbtn" href="javascript:void(0);">
	
		<c-rt:choose>
		<c-rt:when test="${param.sortOrderType==0}">
		上架时间新到旧
		</c-rt:when>
		<c-rt:when test="${param.sortOrderType==1}">
		上架时间旧到新
		</c-rt:when>
		<c-rt:when test="${param.sortOrderType==2}">
		价格低到高
		</c-rt:when>
		<c-rt:when test="${param.sortOrderType==3}">
		价格高到低
		</c-rt:when>
		<c-rt:when test="${param.sortOrderType==4}">
		销售排行高到低
		</c-rt:when>
		<c-rt:when test="${param.sortOrderType==5}">
		销售排行低到高
		</c-rt:when>
		<c-rt:when test="${param.sortOrderType==6}">
		默认排序
		</c-rt:when>
		<c-rt:otherwise>默认排序</c-rt:otherwise>
	</c-rt:choose>

	</a>
	
	<ul class="filterdrop" style="display:none">
	<li><${param.sortOrderType==0?'div class="switchon"':'a' } href="#" onclick="$('#sortOrderType').attr('value', 0);$('.orderbtn').html($(this).html());encodeKeyword2_()">上架时间新到旧</${param.sortOrderType==0?'div':'a' }></li>
	<li class="groupend"><${param.sortOrderType==1?'div class="switchon"':'a' } href="#" onclick="$('#sortOrderType').attr('value', 1);$('.orderbtn').html($(this).html());encodeKeyword2_()">上架时间旧到新</${param.sortOrderType==1?'div':'a' }></li>
	<li><${param.sortOrderType==2?'div class="switchon"':'a' } href="#" onclick="$('#sortOrderType').attr('value', 2);$('.orderbtn').html($(this).html());encodeKeyword2_()">价格低到高</${param.sortOrderType==2?'div':'a' }></li>
	<li class="groupend"><${param.sortOrderType==3?'div class="switchon"':'a' } href="#" onclick="$('#sortOrderType').attr('value', 3);$('.orderbtn').html($(this).html());encodeKeyword2_()">价格高到低</${param.sortOrderType==3?'div':'a' }></li>
	<li><${param.sortOrderType==4?'div class="switchon"':'a' } href="#" onclick="$('#sortOrderType').attr('value', 4);$('.orderbtn').html($(this).html());encodeKeyword2_()">销售排行高到低</${param.sortOrderType==4?'div':'a' }></li>
	<li class="groupend"><${param.sortOrderType==5?'div class="switchon"':'a' } href="#" onclick="$('#sortOrderType').attr('value', 5);$('.orderbtn').html($(this).html());encodeKeyword2_()">销售排行低到高</${param.sortOrderType==5?'div':'a' }></li>
	<li><${(param.sortOrderType==6||empty param.sortOrderType)?'div class="switchon"':'a' } href="#" onclick="$('#sortOrderType').attr('value', 6);$('.orderbtn').html($(this).html());encodeKeyword2_()">默认排序</${(param.sortOrderType==6||empty param.sortOrderType)?'div':'a' }></li>
	
	</ul>
	<input type="hidden" name="sortOrderType" value="${!empty param.sortOrderType?param.sortOrderType:'6' }" id="sortOrderType"/>
	</div></div>  
	
<div class="f-lt"><span class="show-num">每页显示：</span>
<select class="" name="pageSize" onchange="encodeKeyword2_()">
<option value="40" <c-rt:if test="${pageSize==40 }">selected="selected"</c-rt:if>>40</option>
<option value="60" <c-rt:if test="${pageSize==60 }">selected="selected"</c-rt:if>>60</option>
</select>
</div> 

	  <p align="right">共${pager.totalSize}笔： ${pager.currentPage+1}/${pager.pageSize} 
	  	<c-rt:set var="urlpath" value="categoryAll.do?z=${category.id}&sortOrderType=${param.sortOrderType }&pageSize=${pageSize }&pager.currentPage="/>
	  	<c-rt:choose>
	  		<c-rt:when test="${pager.currentPage==0}"><span class="a-no">上一页 |</span></c-rt:when>
	  		<c-rt:otherwise>
	  			<a href="${urlpath}${pager.currentPage-1}" class="a-togo">上一页</a> |
	  		</c-rt:otherwise> 
	  	</c-rt:choose>
	  	<c-rt:choose>
	  		<c-rt:when test="${pager.currentPage == pager.pageSize-1 }"><span class="a-no">下一页</span></c-rt:when>
	  		<c-rt:otherwise>
	  			<a href="${urlpath}${pager.currentPage+1}" class="a-togo">下一页</a>
	  		</c-rt:otherwise>
	  	</c-rt:choose>
	  </p>
	  </div>
  </div>
</form>
<div id="moreInfoDiv" style="position:absolute;z-index:999;display:none">
<iframe id="moreInfoIframe"></iframe>
</div>
  <!-- 圖片結果展示區 -->
	<ul class="pdlist-img">
		<c-rt:forEach items="${results}" var="doc" varStatus="status">
			<c-rt:set var="pId" value="${doc['PRODUCT_ID']}"/>	
			${pu:reqSet('product', pu:get('com.yaodian100.ec.product.entity.Product', doc['PRODUCT_ID'])) }

${pu:reqSet('categoryId', doc['CATEGORY_ID']) }
${pu:reqSet('ct', doc['CATEGORY_ID']) }
	<c-rt:if test="${product.productType ne 6}">
		   	<%try{ %>
		   	
       ${pu:reqSet('pcampaigns', pu:validCampaign(ct, doc['PRODUCT_ID'])) }
       	
       	<%}catch(Exception e){} %>
</c-rt:if>

	  	<li>
	  	
	  	<input type="hidden" name="productId" id="productId${status.index }" value="${doc['PRODUCT_ID'] }"/>
        	<input type="hidden" name="ct" id="ct${status.index }" value="${ct }"/>
			<input type="hidden" name="productId_4" id="productId_4${status.index }" value="${pu:substring(doc['PRODUCT_ID'], 0, 4)}"/>
			${pu:reqSet('promoteName', doc['PROMOTE_NAME']) }
			${pu:reqSet('"escapePromoteName"', pu:replaceAll(doc['PROMOTE_NAME'], pu:urlDecoding(param.searchKeyword, 'UTF-8'), rpn)) }
			${pu:reqSet('escapeProductName', pu:replaceAll(doc['PRODUCT_NAME'], pu:urlDecoding(param.searchKeyword, 'UTF-8'), rpn) ) }
			
			<%
			String promoteName=(String)request.getAttribute("promoteName");
			if(promoteName!=null)
			promoteName=promoteName.replaceAll("\r\n", "").replaceAll("\r", "").replaceAll("\n", "").replaceAll("\'", "&#39;");
			String escapePromoteName=(String)request.getAttribute("escapePromoteName");
			if(escapePromoteName!=null)
			escapePromoteName=escapePromoteName.replaceAll("\r\n", "").replaceAll("\r", "").replaceAll("\n", "").replaceAll("\'", "&#39;");
			String escapeProductName=(String)request.getAttribute("escapeProductName");
			if(escapeProductName!=null)
			escapeProductName=escapeProductName.replaceAll("\r\n", "").replaceAll("\r", "").replaceAll("\n", "").replaceAll("\'", "&#39;");
			
			%>
			<input type="hidden" name="promoteName" id="promoteName${status.index }" value="${promoteName }"/>
			<input type="hidden" name="escapePromoteName" id="escapePromoteName${status.index }" value="${escapePromoteName }"/>
			<input type="hidden" name="escapeProductName" id="escapeProductName${status.index }" value="${escapeProductName }"/>
			<input type="hidden" name="listPrice" id="listPrice${status.index }" value="${doc['LIST_PRICE'] }"/>
			<input type="hidden" name="shelfPrice" id="shelfPrice${status.index }" value="${doc['SHELF_PRICE']}"/>
			<c-rt:if test="${!empty pcampaigns}">
			 <c-rt:forEach items="${pcampaigns}" var="campaign">
			 ${pu:reqSet('theCampaignName', campaign.campaignName) }
			 <%
			 String theCampaignName=(String)request.getAttribute("theCampaignName");
			 if(theCampaignName!=null)
			 theCampaignName=theCampaignName.replaceAll("\r\n", "").replaceAll("\r", "").replaceAll("\n", "").replaceAll("\'", "&#39;");
			 %>
            <input type="hidden" name="campaigns" class="campaigns${status.index }" value="${theCampaignName }"/>
            </c-rt:forEach>
			</c-rt:if>
			 ${pu:reqSet('paramsCampaign', null) }
            ${pu:reqSet('hqlCampaign', 'from Campaign c where ? in elements(c.rangeExtList) and c.enable = ? and c.delete = ? and c.startDateTime <= ? and c.endDateTime >= ? and c.type=?')}
           	${pu:listAdd('paramsCampaign', pu:toString(doc['PRODUCT_ID'])) }
           	${pu:listAdd('paramsCampaign', pu:toBoolean('true')) }
           	${pu:listAdd('paramsCampaign', pu:toBoolean('false')) }
           	${pu:listAdd('paramsCampaign', currentDate) }
           	${pu:listAdd('paramsCampaign', currentDate) }
           	${pu:listAdd('paramsCampaign', 'S01')}
           	${pu:reqSet('campaigns', pu:queryByHql(hqlCampaign, pu:arrayGet('paramsCampaign'), null)) }
           	           
           	<c-rt:if test="${campaigns[0].typeExtends[0].campaignTypeExtension > 0}">
           	<input type="hidden" name="hasCoupon" id="hasCoupon${status.index }" value="true"/>
			<input type="hidden" name="coupon" id="coupon${status.index }" value="${campaigns[0].campaignAmount }"/>
           	</c-rt:if>
			
			 ${pu:reqSet('params', null) }
			 ${pu:reqSet('presentStr', '') }
            ${pu:reqSet('presentHql', 'from AddOnProduct where mainProductId=? and addOnPrice=? and isEnable=? and isDelete=? and startDate<=? and endDate>=?') }
						${pu:listAdd('params', doc['PRODUCT_ID']) }
						${pu:listAdd('params', pu:toLong(0)) }
						${pu:listAdd('params', 'Y') }
						${pu:listAdd('params', 'N') }
						${pu:listAdd('params', currentDate) }
						${pu:listAdd('params', currentDate) }
						${pu:reqSet('presents', pu:queryByHql(presentHql, pu:arrayGet('params'), null)) }
						<c-rt:forEach items="${presents}" var="present" varStatus="presentIndex">
						${pu:reqSet('pp', pu:get('com.yaodian100.ec.product.entity.Product', present.addOnProductId)) }
							${pu:listAdd('pProducts', pp) }
							<c-rt:if test="${pProducts[presentIndex.index].isDelete != 'Y' and pProducts[presentIndex.index].isDelete != 'Q'}">
								<c-rt:forEach items="${pProducts[presentIndex.index].specifications}" var="spec" varStatus="ssssaaaa">
									<c-rt:if test="${spec.isDelete!='Y'}">
										${pu:reqSet('psInventory', null)}
										${pu:listAdd('psInventory', spec.specificationId)}
										${pu:reqSet('specInventorys2', pu:queryByHql('from SpecificationInventory where specId=?', pu:arrayGet('psInventory'), null))}
										<c-rt:if test="${specInventorys2[0].inventory>0}">
											<c-rt:if test="${!empty presentStr}">
											<c-rt:set var="presentStr" scope="request">
											${presentStr },${present.addOnDesc}
											</c-rt:set>
											</c-rt:if>
											<c-rt:if test="${empty presentStr}">
											<c-rt:set var="presentStr" scope="request">
											${present.addOnDesc}
											</c-rt:set>
											</c-rt:if>
										</c-rt:if>
									</c-rt:if>
								</c-rt:forEach>
							</c-rt:if>
						</c-rt:forEach>   
			<c-rt:if test="${!empty presents}">
			<%
			String present=(String)request.getAttribute("presentStr");
			if(present!=null)
			present=present.replaceAll("\r\n", "").replaceAll("\r", "").replaceAll("\n", "").replaceAll("\'", "&#39;");
			%>
			<input type="hidden" name="hasPresent" id="hasPresent${status.index }" value="true"/>
			<input type="hidden" name="present" id="present${status.index }" value="${presentStr}"/>
			</c-rt:if>
			<input type="hidden" name="productType" id="productType${status.index }" value="${product.productType}"/>
			
			            <c-rt:if test="${product.productType ne 6}">
            ${pu:reqSet('params', null) }
			${pu:reqSet('addOnHql', 'from AddOnProduct where mainProductId=? and addOnPrice!=? and isEnable=? and isDelete!=? and startDate <=? and endDate >=?') }
			
			${pu:listAdd('params', doc['PRODUCT_ID']) }
			${pu:listAdd('params', pu:toLong(0)) }
			${pu:listAdd('params', 'Y') }
			${pu:listAdd('params', 'Y') }
			${pu:listAdd('params', currentDate) }
			${pu:listAdd('params', currentDate) }
			${pu:reqSet('addOnProducts', pu:queryByHql(addOnHql, pu:arrayGet('params'), null)) }
			<c-rt:if test="${!empty addOnProducts}">
			<input type="hidden" name="hasAddon" id="hasAddon${status.index }" value="true"/>
			</c-rt:if>
			</c-rt:if>
			<c-rt:if test="${!empty product.expectShipDate}">
			<c-rt:set var="expectShipDate" scope="request">
			<fmt-rt:formatDate value="${product.expectShipDate}" pattern="yyyy-MM-dd"/>
			</c-rt:set>
			</c-rt:if>
			<input type="hidden" name="expectShipDate" id="expectShipDate${status.index }" value="${expectShipDate}"/>
			
			
			
	  	<div class="p_div" id="p_div_${status.index }">
		   	<a href="${frontContentPath}/product/product.do?productId=${pId}&z=${ct}" target="_blank">
				<yaodian100:productImg productId="${pId}" postfix="rm225" height="225" width="170" lazy="true" />
		   	</a>
	  	    	
		   	<div id="theId_${status.index }">
		   

<div class="morepdinfo1" id="morepdinfo1_${status.index }" style="display:none">
 <div id="infoLeft_${status.index }" class="arrowarea"><img src="/images/mpdinfo-areal.gif" border="0" style="border:0px"></div>
<div class="pdinfo">
        </div>
        <div id="infoRight_${status.index }" class="arrowarea"><img src="/images/mpdinfo-arear.gif" border="0" style="border:0px"></div>



				</div>
        	</div>
				</div>
	  	  
	  	  
	  	  
	  	  
	  	  
	  	  
	  	  <em <c-rt:if test="${!empty pcampaigns }">class="pficon"</c-rt:if>>${doc['PROMOTE_NAME']}</em>
	      <h6>
		      <a href="${frontContentPath}/product/product.do?productId=${pId}&z=${ct}" target="_blank">
		      ${doc['PRODUCT_NAME']}
		      </a>
	      </h6>
 	      <s><span>￥<fmt-rt:formatNumber value="${doc['LIST_PRICE']}" pattern="#####0.0" /></span></s>
	      <strong>￥<fmt-rt:formatNumber value="${doc['SHELF_PRICE']}" pattern="#####0.0" /></strong>
	   <i><c-rt:if test="${doc['IS_SOLD_OUT']=='Y'}">已售完补货中</c-rt:if></i>
	    </li>
    </c-rt:forEach>
	</ul>
	<s:form action="categoryAll.do" method="post" id="categoryForm">
		<input type="hidden" name="sortOrderType" value="${param.sortOrderType }"/>
		<input type="hidden" name="pageSize" value="${pageSize }"/>
		<input type="hidden" name="z" value="${category.id}"/>
	</s:form>
	<p class="cf" align="center">
	<yaodian100:pager10 link="categoryAll.do?z=${category.id}&sortOrderType=${param.sortOrderType }&pageSize=${pageSize }" pagerObj="${pager}" />
	</p>
	<div id="dialog"></div>
	
</div>	